package com.rx.mylist.controller;

import com.rx.core.base.RxBaseConstant;
import com.rx.core.base.RxBaseController;
import com.rx.mylist.service.ListOwnerService;
import com.rx.mylist.service.ListService;
import com.rx.mylist.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(RxBaseConstant.CONFIG_COMMON_API)
@Slf4j
public class ListController extends RxBaseController {

    @Autowired
    ListService myListService;
    @Autowired
    ListOwnerService listOwnerService;

    @PostMapping(value = "/list-login")
    public Object appLogin(@RequestBody ListLoginVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.appLogin(appLoginVo);
    }
    @PostMapping(value = "/update-user")
    public Object updateUser(@RequestBody ListLoginVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.updateUser(appLoginVo);
    }
    @PostMapping(value = "/list-sign")
    public Object sign(@RequestBody ListLoginVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.sign(appLoginVo);
    }

    @PostMapping(value = "/list-square")
    public Object listSquare(@RequestBody ListLoginVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listSquare(appLoginVo);
    }

    @PostMapping(value = "/list-square-page")
    public Object listSquarePage(@RequestBody ListSearchVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listSquarePage(appLoginVo);
    }

    @PostMapping(value = "/list-product-page")
    public Object listProductPage(@RequestBody ListSearchVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listProductPage(appLoginVo);
    }

    @PostMapping(value = "/list-item-infos")
    public Object listItemInfos(@RequestBody ListSearchVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listItemInfos(appLoginVo);
    }

    @PostMapping(value = "/list-image-page")
    public Object listImagePage(@RequestBody ListSearchVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listImagePage(appLoginVo);
    }

    @PostMapping(value = "/add-list-model")
    public Object addListByModel(@RequestBody ListAddVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.addListByModel(appLoginVo);
    }

    @PostMapping(value = "/my-list-page")
    public Object myListPage(@RequestBody ListAddVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.myListPage(appLoginVo);
    }

    @PostMapping(value = "/my-list-detail")
    public Object myListDetail(@RequestBody ListAddVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.myListDetail(appLoginVo);
    }

    @PostMapping(value = "/do-list")
    public Object doList(@RequestBody ListAddVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.doList(appLoginVo);
    }
    @PostMapping(value = "/delete-list")
    public Object deleteList(@RequestBody ListAddVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.deleteList(appLoginVo);
    }

    @PostMapping(value = "/list-auth-page")
    public Object listAuthPage(@RequestBody ListSearchVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listAuthPage(appLoginVo);
    }

    @PostMapping(value = "/do-list-auth")
    public Object doListAuth(@RequestBody ListAddVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.doListAuth(appLoginVo);
    }

    @PostMapping(value = "/do-bless")
    public Object doBless(@RequestBody ListAddBlessVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.doBless(appLoginVo);
    }

    @PostMapping(value = "/list-bless-page")
    public Object listBlessPage(@RequestBody ListAddBlessVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.listBlessPage(appLoginVo);
    }

    /**
     * 祝福统计
     * @param appLoginVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/pre-ticket-page")
    public Object preTicketPage(@RequestBody ListAddBlessVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.preTicketPage(appLoginVo);
    }

    @PostMapping(value = "/do-ticket")
    public Object doTicket(@RequestBody ListAddBlessVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.doTicket(appLoginVo);
    }

    /**
     * 公司货物分类
     * @param appLoginVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/company-title")
    public Object companyTitle(@RequestBody ListCompanyTitle appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.companyTitle(appLoginVo);
    }

    /**
     * @description:公司二维码
     * @author: 陈锦韬
     * @date: 2023/2/25 12:41
     * @param: [appLoginVo]
     * @return: java.lang.Object
     **/
    @PostMapping(value = "/company-qr")
    public Object companyQr(@RequestBody DoCommonVo commonVo) throws IllegalAccessException, InstantiationException {
        return myListService.companyQr(commonVo);
    }
    @PostMapping(value = "/company-by-scene")
    public Object companyByScene(@RequestBody DoCommonVo commonVo) throws IllegalAccessException, InstantiationException {
        return myListService.companyByScene(commonVo);
    }
    /**
     * 获取token
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/access_token")
    public Object accessToken(@RequestBody ListLoginVo appLoginVo) throws IllegalAccessException, InstantiationException {
        return myListService.accessToken(appLoginVo);
    }
    //
    //
    //

    @PostMapping(value = "/batch-delete")
    public Object batchDelete(@RequestBody DoCommonVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.batchDelete(doOwnerVo);
    }



    /**
     * 创建业委会
     * @param doOwnerVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/do-owner")
    public Object doOwner(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.doOwner(doOwnerVo);
    }

    @PostMapping(value = "/owner-page")
    public Object ownerPage(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.ownerPage(doOwnerVo);
    }

    /**
     * 业主圈关联
     * @param doOwnerVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/owner-connect")
    public Object ownerConnect(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.ownerConnect(doOwnerVo);
    }

    /**
     * 更换创建人
     * @param doOwnerVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/owner-mp-connect")
    public Object ownerMpConnect(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.ownerMpConnect(doOwnerVo);
    }
    /**
     * 获取密钥
     * @param doOwnerVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/key-secret")
    public Object keySecret(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.keySecret(doOwnerVo);
    }

    /**
     * 门禁验证
     * @param doOwnerVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/check-secret")
    public Object checkSecret(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.checkSecret(doOwnerVo);
    }

    /**
     * 门禁验证
     * @param doOwnerVo
     * @return
     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    @PostMapping(value = "/save-guard")
    public Object saveGuard(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.saveGuard(doOwnerVo);
    }

    @PostMapping(value = "/guard-page")
    public Object guardPage(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.guardPage(doOwnerVo);
    }

    @PostMapping(value = "/guard-image")
    public Object guardImage(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.guardImage(doOwnerVo);
    }
    @PostMapping(value = "/save-home")
    public Object saveHome(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.saveHome(doOwnerVo);
    }
    @PostMapping(value = "/home-page")
    public Object homePage(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.homePage(doOwnerVo);
    }

    @PostMapping(value = "/save-visit")
    public Object saveVisit(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.saveVisit(doOwnerVo);
    }
    @PostMapping(value = "/visit-page")
    public Object visitPage(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.visitPage(doOwnerVo);
    }
    @PostMapping(value = "/audit-visit")
    public Object auditVisit(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.auditVisit(doOwnerVo);
    }
    @PostMapping(value = "/obtain-visit")
    public Object obtainVisit(@RequestBody DoOwnerVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.obtainVisit(doOwnerVo);
    }
    @PostMapping(value = "/member-page")
    public Object memberPage(@RequestBody DoMemberVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.memberPage(doOwnerVo);
    }
    @PostMapping(value = "/member-hi-page")
    public Object memberHiPage(@RequestBody DoMemberVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.memberHiPage(doOwnerVo);
    }
    @PostMapping(value = "/material-page")
    public Object materialPage(@RequestBody DoMemberVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.materialList(doOwnerVo);
    }

    @PostMapping(value = "/save-material")
    public Object materialSave(@RequestBody DoMemberVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.materialSave(doOwnerVo);
    }

    @PostMapping(value = "/save-member")
    public Object saveMember(@RequestBody DoMemberVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.saveMember(doOwnerVo);
    }

    @PostMapping(value = "/delete-member")
    public Object deleteMember(@RequestBody DoMemberVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.deleteMember(doOwnerVo);
    }

    @PostMapping(value = "/essay-page")
    public Object essayPage(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.essayPage(doOwnerVo);
    }

    @PostMapping(value = "/save-essay")
    public Object saveEssay(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.saveEssay(doOwnerVo);
    }
    @PostMapping(value = "/audit-essay")
    public Object completeEssay(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.completeEssay(doOwnerVo);
    }
    @PostMapping(value = "/obtain-essay")
    public Object obtainEssay(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.obtainEssay(doOwnerVo);
    }

    @PostMapping(value = "/delete-essay")
    public Object deleteEssay(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.deleteEssay(doOwnerVo);
    }

    @PostMapping(value = "/schedule-page")
    public Object schedulePage(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.schedulePage(doOwnerVo);
    }

    @PostMapping(value = "/save-schedule")
    public Object saveSchedule(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.saveSchedule(doOwnerVo);
    }

    @PostMapping(value = "/delete-schedule")
    public Object deleteSchedule(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.deleteSchedule(doOwnerVo);
    }

    // 点赞
    @PostMapping(value = "/thumbs-schedule")
    public Object thumbsSchedule(@RequestBody DoNoticeVo doOwnerVo) throws IllegalAccessException, InstantiationException {
        return listOwnerService.thumbsSchedule(doOwnerVo);
    }
}
